<?php

abstract class Bets
{
	
	protected $_id;
	protected $_status;
	protected $_user_id;
	protected $_contest_id;
	protected $_scheduleEvent_id;
	protected $_dateBet;
	
	public function __construct(array $donnees)
	{
		$this->hydrate($donnees);
	}
	
	public function hydrate(array $donnees)
	{
		foreach($donnees as $key => $value)
		{
			$method = 'set'. ucfirst($key);
			if(method_exists($this, $method))
			{
				$this->$method($value);
			}
		}
	}
	
	public function id() { return $this->_id; }
	public function status() { return $this->_status; }
	public function contest_id() { return $this->_contest_id; }
	public function user_id() { return $this->_user_id; }
	public function scheduleEvent_id() { return $this->_scheduleEvent_id; }
	public function dateBet() { return $this->_dateBet; }
	
	public function setId($id)
	{
		$id = (int) $id;
		if(is_int($id))
		{
			$this->_id = $id;
		}
	}
	public function setStatus($status)
	{
		$status = (int) $status;
		if(is_int($status))
		{
			$this->_status = $status;
		}
	}
	public function setContest_id($contest_id)
	{
		$contest_id = (int) $contest_id;
		if(is_int($contest_id))
		{
			$this->_contest_id = $contest_id;
		}
	}
	public function setUser_id($user_id)
	{
		$user_id = (int) $user_id;
		if(is_int($user_id))
		{
			$this->_user_id = $user_id;
		}
	}
	public function setScheduleEvent_id($scheduleEvent_id)
	{
		$scheduleEvent_id = (int) $scheduleEvent_id;
		if(is_int($scheduleEvent_id))
		{
			$this->_scheduleEvent_id = $scheduleEvent_id;
		}
	}
	public function setDateBet($dateBet)
	{
		$dateBet = (String) $dateBet;
		if(is_string($dateBet))
		{
			$this->_dateBet = $dateBet;
		}
	}
}

?>